﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckLiked.aspx.cs" Inherits="ProjectQuaDep.CheckLiked" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="/Css/style.css?v=346" type="text/css" />
    <link rel="stylesheet" href="/Css/chosen.css?v=347" type="text/css" />
    <link rel="stylesheet" href="/Css/jquery-ui-1.10.3.custom.css?v=47" type="text/css" />
    <script type="text/javascript" language="javascript" src="/js/jquery.js"></script>
    <script type="text/javascript" language="javascript" src="/Js/jquery.ajaxupload.js"></script>
    <script type="text/javascript" language="javascript" src="/js/easing.js"></script>
    <script type="text/javascript" language="javascript" src="/js/jquery.cycle.all.js"></script>
    <script type="text/javascript" language="javascript" src="/js/chosen.jquery.js"></script>
    <script type="text/javascript" language="javascript" src="/js/jquery-ui-1.10.3.custom.js"></script>
    <script type="text/javascript" language="javascript" src="/js/jquery.center.js"></script>
    <script type="text/javascript" language="javascript" src="/js/aigiongai.js?v=45"></script>
    <script type="text/javascript" src="/Js/tools.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="fb-root">
    </div>
    <script type="text/javascript">
        window.fbAsyncInit = function () {
            FB.init({
                appId: '497721113668637',
                status: true,
                cookie: true,
                xfbml: true
            });

            FB.Event.subscribe('edge.create',
            function (response, widget) {
                alert(widget.toSource());
            });
        };

        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/vi_VN/all.js";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));
    </script>

    <script type="text/javascript">
        function checkLikeFanpage() {
            FB.getLoginStatus(function (response) {
                var page_id = "150159721818778";
                if (response && response.authResponse) {
                    var user_id = response.authResponse.userID;
                    var fql_query = "SELECT uid FROM page_fan WHERE page_id = " + page_id + "and uid=" + user_id;
                    FB.Data.query(fql_query).wait(function (rows) {
                        if (rows.length == 1 && rows[0].uid == user_id) {
                            console.log('Liked');
                        }
                        else {
                            console.log('Not Like');
                        }
                    });
                } else {
                    FB.login(function (response) {
                        if (response && response.authResponse) {
                            var user_id = response.authResponse.userID;
                            var fql_query = "SELECT uid FROM page_fan WHERE page_id = " + page_id + "and uid=" + user_id;
                            FB.Data.query(fql_query).wait(function (rows) {
                                if (rows.length == 1 && rows[0].uid == user_id) {
                                    console.log('Liked');
                                }
                                else {
                                    console.log('Not Like');
                                }
                            });
                        }
                    }, { scope: 'publish_actions, user_likes', display: 'popup' });
                }
            });
        }
    </script>
    <a href="javascript:void(0)" onclick="checkLikeFanpage()"><b><img src="/images/web/vote.gif" /></b></a>
    <fb:like href="https://www.facebook.com/conyeu.yeucon" layout="standard" sent="false" action="like" show_faces="false" share="false"></fb:like>
    <%--$.modal.close();--%>
    <%--<fb:like-box href="https://www.facebook.com/conyeu.yeucon" width="292" show_faces="false" stream="false" header="false"></fb:like-box>--%>
    </form>
</body>
</html>
